package com.gitee.luosl.cola.lang.function.checked;

import com.gitee.luosl.cola.lang.function.Function3;

public interface CheckedFunction3<T1, T2, T3, R> {

    R apply(T1 t1, T2 t2, T3 t3) throws Throwable;

    default Function3<T1, T2, T3, R> toFunction3() {
        return (t1, t2, t3) -> {
            try {
                return apply(t1, t2, t3);
            }catch (Throwable throwable){
                throw new CheckedException(throwable);
            }
        };
    }
}
